-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial range request support #1388
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
9b4676f
to
a381108
Compare
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
all green, good to merge! |
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
/* | ||
if md.Checksum != "" { | ||
w.Header().Set("OC-Checksum", md.Checksum) | ||
} | ||
*/ | ||
if _, err := io.Copy(w, httpRes.Body); err != nil { | ||
var c int64 | ||
if c, err = io.Copy(w, httpRes.Body); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should return an error status in this case, right? Currently it would just return OK or partial content if the GET request above didn't return any error. Same for the errors below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually we can't because the header has already been sent and the Copy is streaming the bytes.
All we can do is log that something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but if the copy fails, user would still receive a 200 with corrupt file contents.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct. even if we would buffer everything into ram ... we cannot change the http header when the body is being sent. The best we can do is log an error.
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Lint needs to be fixed |
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
The desktop client uses range requests to continue downloads. It does not expect the full content / a 200 OK response and would assemble a broken file.
EOS has to download the whole file to the storage provider ... I did not find an option to
xrdcopy
that would allow reducing the size. So I left theFS.Download()
interface as is. It actually is just anOpen()
and should be renamed anyway.deprecates #701
Signed-off-by: Jörn Friedrich Dreyer jfd@butonic.de